/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mentaproduto.action;

import org.mentawai.core.Action;
import org.mentawai.filter.ValidationFilter;
import org.mentawai.rule.RegexRule;
import org.mentawai.rule.RequiredRule;
import org.mentawai.validation.Validator;

public class Validacao extends ValidationFilter implements Mensagens {

    @Override
    public void prepareValidator(Validator val, Action action, String innerAction) {
        val.add("txtNome", new RequiredRule(), FIELD_REQUIRED_ERROR);
        val.add("txtDescricao", new RequiredRule(), FIELD_REQUIRED_ERROR);
        val.add("txtPreco", new RequiredRule(), FIELD_REQUIRED_ERROR);
        val.add("txtPrecoPromocional", new RequiredRule(), FIELD_REQUIRED_ERROR);
        val.add("txtFoto", new RequiredRule(), FIELD_REQUIRED_ERROR);

    }
}
